<include file="public:header" />
<include file="public:left" />
<div class="panel-group" id="accordion">
    <form action="{:U('role/relationEditor')}" method="post"   >
    <button type="submit" class="btn btn-primary">保存配置</button>
    <br>
    <br>
        <volist name="list" id="val">
        <div class="panel panel-info" >
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a  data-toggle="collapse" data-parent="#accordion"  href="#collapseOne{$val.id}">{$val.name}</a>
                </h4>
            </div>
            <div  id="collapseOne{$val.id}" class="panel-collapse collapse in">
                <div class="panel-body">
                    <volist name="val.modules_list" id="val2">
                        <div class="role-relation-modules">
                            <label class="checkbox-inline">
                                <input type="checkbox" <if condition="in_array($val2['id'],$modules) neq ''" > checked </if> onchange="checkBoxAll($(this))" alt="checkbox-inline-check{$val2.id}" > {$val2.name}
                            </label>
                            <div class="role-relation-modules-func">
                                <volist name="val2.modules_func_list" id="val3">
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="modules[]" <if condition="in_array($val3['id'],$select) neq ''" > checked </if> value="{$val3.id}"  class="checkbox-inline-check{$val2.id}"> {$val3.name}
                                </label>
                                </volist>
                            </div>
                        </div>
                    </volist>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            $(function () {
                $('#collapseOne{$val.id}').collapse({toggle: false});
            });
        </script>
        </volist>
        <input type="hidden" name="id" value="{$id}">
    </form>
</div>
<include file="public:footer" />